package cz.data.common.support.db.manage;

import cz.data.common.support.db.DbType;

import java.util.HashMap;
import java.util.Map;

public class ManageDialectRegistry {
    public static final DefaultManageDialect defaultDialect = new DefaultManageDialect();

    private static final Map<DbType, ManageDialect> registry = new HashMap<>();

    public static void registry(ManageDialect dialect, DbType... dbTypes) {
        for (DbType dbType : dbTypes) {
            registry.put(dbType, dialect);
        }
    }

    public static ManageDialect factory(DbType dbType) {
        return registry.getOrDefault(dbType, defaultDialect);
    }

    public static class DefaultManageDialect implements ManageDialect {

    }
}
